# !/usr/bin/env python
# encoding: utf-8


"""
  @author: gaogao
  @file: L8164B_App.py
  @time: 2022/3/12 10:34
  @desc:
"""
from ATS.instrumentDriver.InstGenSS.InstGenSS_L8164B import SS_L8164B


class L8164B_App:
    def __init__(self, name):
        self.l8164b = SS_L8164B(name)

    def idn(self):
        return self.l8164b.idn()

    def cls(self):
        self.l8164b.cls()

    def reset(self):
        self.l8164b.reset()

    def set_power_value(self, power_value):
        self.l8164b.set_power(power_value)

    def set_wave_length(self, wave_length):
        self.l8164b.set_wave_length(wave_length)

    def trigger(self):
        self.l8164b.trigger()

    def get_sweep_status(self):
        return self.l8164b.get_sweep_status()

    def output_on(self):
        self.l8164b.output_on()

    def output_off(self):
        self.l8164b.output_off()

    def trigger_input(self):
        self.l8164b.trigger_input()

    def trigger_output(self):
        self.l8164b.trigger_output()

    def set_power_unit(self, unit=0):
        self.l8164b.set_power_unit(unit)

    def trigger_config(self):
        self.l8164b.trigger_config()

    def set_start_stop_step_wave(self, start_wave, stop_wave, step_wave):
        self.l8164b.set_start_stop_step_wave(start_wave, stop_wave, step_wave)

    def set_wave_sweep_speed(self, speed=100):
        self.l8164b.set_wave_sweep_speed(speed)

    def set_repeat_mode(self):
        self.l8164b.set_repeat_mode()

    def set_sweep_mode(self):
        self.l8164b.set_sweep_mode()

    def stop_sweep(self):
        self.l8164b.stop_sweep()

    def query_sweep_pmax(self, start_wave, stop_wave):
        return self.l8164b.query_sweep_pmax(start_wave, stop_wave)

    def set_wave_sweep_state(self, state=1):
        self.l8164b.set_wave_sweep_state(state)

    def fetch_input_power(self):
        return self.l8164b.fetch_power_value()

    def get_source_wavelength(self):
        return self.l8164b.get_source_wavelength()
